package com.anlogic.sdk.utils.options;

import java.util.LinkedHashMap;
import java.util.Map;

public enum ArchType {
	AArch32("AArch32", "AArch32"), AArch64("AArch64", "AArch64"), RISCV("riscv", "riscv");

	private String id;
	
	private String name;

	private static Map<String, ArchType> idMap = new LinkedHashMap<>();

	private static Map<String, ArchType> nameMap = new LinkedHashMap<>();

	static {
		for (ArchType value : ArchType.values()) {
			idMap.put(value.getId(), value);
			nameMap.put(value.getName(), value);
		}
	}

	ArchType(String id, String name) {
		this.id = id;
		this.name = name;
	}

	public String getId() {
		return this.id;
	}

	public String getName() {
		return this.name;
	}

	public static String[] getIds() {
		return idMap.keySet().toArray(new String[0]);
	}

	public static String[] getNames() {
		return nameMap.keySet().toArray(new String[0]);
	}

	public static ArchType getTypeById(String id) {
		return idMap.get(id);
	}

	public static ArchType getTypeByName(String name) {
		return nameMap.get(name);
	}
}
